/********************************************************************
	file base:	GlobalVariabel
	file ext:	h
	author:		JiangHuai
	
	purpose:	define some useful global variable
*********************************************************************/


#ifndef GLOBAL_VARIABLE
#define GLOBAL_VARIABLE

#include "Info.h"
#include <commdlg.h>

#include <commctrl.h>
#define MAX_LENGTH 4196

//for open file dialog
OPENFILENAME ofn;
TCHAR FileNameFilter[] = TEXT("BMP *.bmp\0*.bmp\0JPG *.jpg\0*.jpg\0GIF *.gif\0*.gif\0TIF *.tif\0*.tif\0\0");
TCHAR OpenFileName[MAX_PATH];
TCHAR FileTitleName[MAX_PATH];

void InitializeOfn() {
	ofn.lStructSize       = sizeof (OPENFILENAME) ;
	ofn.hInstance         = NULL ;
	ofn.lpstrFilter       = FileNameFilter ;
	ofn.lpstrCustomFilter = NULL ;
	ofn.nMaxCustFilter    = 0 ;
	ofn.nFilterIndex      = 0 ;
	ofn.lpstrFile         = (LPTSTR)&OpenFileName ;
	ofn.nMaxFile          = MAX_PATH ;
	ofn.lpstrFileTitle    = FileTitleName ;
	ofn.nMaxFileTitle     = MAX_PATH ;
	ofn.lpstrInitialDir   = NULL ;
	ofn.lpstrTitle        = NULL ;
	ofn.Flags             = 0 ;
	ofn.nFileOffset       = 0 ;
	ofn.nFileExtension    = 0 ;
	ofn.lpstrDefExt       = TEXT ("bmp") ;
	ofn.lCustData         = 0 ;
	ofn.lpfnHook          = NULL ;
	ofn.lpTemplateName    = NULL ;
	return;
}
//end open file dialog

#endif